{% extends "base.volt" %}

        {% block pageHeader %}
        {{ stylesheet_link("/libs/bootstrap-datepicker-1.4.0/css/bootstrap-datepicker.min.css", false) }}
        {% endblock %}

{% block pageFooter%}
    {{ javascript_include("/js/area.js", false) }}
    {{ javascript_include("/libs/bootstrap-datepicker-1.4.0/js/bootstrap-datepicker.js", false) }}
    {{ javascript_include("/libs/bootstrap-datepicker-1.4.0/locales/bootstrap-datepicker.zh-CN.min.js", false) }}
    {{ javascript_include("/assets/manage/js/user/edit.js", false) }}
{% endblock %}

{% block content %}
{{ partial("module/left_user") }}

<div class="col-xs-10">
    <ol class="breadcrumb">
        <li><a href="{{ url.get('user/list')  }}">用户管理</a></li>
        <li class="active">编辑会员信息</li>
    </ol>
    <form id="form_update" class="form-horizontal" role="form" method="post" action="{{ url.get('user/editsave') }}" target="ifr_send_file" enctype="multipart/form-data" urlList="{{ url.get('user/list?type=1') }}">
        <div class="form-group">
            <label for="bp_name" class="col-xs-2 control-label">账户</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="account" name="account" value="{{ userInfo.user_account}}" readonly="readonly" data-rule="required;">
            </div>
        </div>
        <div class="form-group">
            <label for="bp_cover" class="col-xs-2 control-label">头像</label>
            <div class="col-xs-9">
            	<a href="{{ userInfo.user_cover }}" target="_blank"><img src="{{ userInfo.user_cover }}" style="width:100px; height:100px;"/></a>
                <input type="file" class="form-control" id="avatar" name="avatar" >
                <p class="help-block">图片必须是正方形的，高宽都必须大于200px，大小不得超过2M</p>
            </div>
        </div>
        <div class="form-group">
            <label for="district" class="col-xs-2 control-label">城市</label>
            <div class="form-inline col-xs-9">
                <div class="input-group">
                    <label class="input-group-addon">省</label>
                    <select class="form-control" id="province" dvalue="{{ userArea.P_NM|escape_attr }}">
                        <option value="">请选择...</option>
                    </select>
                    <label class="input-group-addon">市</label>
                    <select class="form-control" id="city" dvalue="{{ userArea.C_NM|escape_attr }}">
                        <option value="">请选择...</option>
                    </select>
                    <label class="input-group-addon">区/县</label>
                    <select class="form-control" name="district" id="district" dvalue="{{ userInfo.user_district }}" data-rule="required(not, -10000);" data-target="#district_error">
                        <option value="-10000">请选择...</option>
                    </select>
                </div>
                <div class="input-group" id="district_error"></div>
            </div>
        </div>
        <!-- <div class="form-group">
            <label for="address" class="col-xs-2 control-label">地址</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="address" name="address" data-rule="required;">
            </div>
        </div> -->
<!--         <div class="form-group">
            <label for="bp_tel" class="col-xs-2 control-label">密码</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="password" name="password" data-rule="required;">
            </div>
        </div> -->
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">昵称</label>
            <div class="col-xs-9">
               <input type="text" class="form-control" id="nickname" name="nickname" value="{{ userInfo.user_nickname }}" data-rule="required;">
               <input type="hidden" name="user_id" value="{{ userId }}">
            </div>
        </div>
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">性别</label>
            <div class="col-xs-6">
                <select name="sex" class="form-control"> 
                	<option value="0">未知</option>
                	<option value="2" {% if userInfo.user_gender ==2 %} selected="selected" {% endif %}>女</option>
                	<option value="1" {% if userInfo.user_gender ==1 %} selected="selected" {% endif %}>男</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">姓名</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="realname" name="realname" value="{{ userInfo.user_realname }}" >
            </div>
        </div>
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">生日</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="birthday" name="birthday" value="{{ userInfo.user_birthday }}" >
            </div>
        </div>
        <div class="form-group">
            <label for="bp_photos" class="col-xs-2 control-label">绑定手机</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="phone" name="phone" value="{{ userInfo.bind_phone }}" >
            </div>
        </div>
        <div class="form-group">
            <label for="bp_owner_mobile" class="col-xs-2 control-label">个性签名</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="persional_sign" name="persional_sign" value="{{ userInfo.persional_sign }}"  >
            </div>
        </div>
        {% if user_attr !='' %}
        <div class="form-group">
            <label for="bp_is_sell" class="col-xs-2 control-label">粉丝数</label>
            <div class="col-xs-6">
                <input type="text" class="form-control" id="expert_follow_count" value="{{ userInfo.expert_follow_count }}" name="expert_follow_count">
            </div>
        </div>
        <div class="form-group">
            <label for="bp_owner_mobile" class="col-xs-2 control-label">从业年限</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" name="experience" value="{{ user_attr.experience }}"   />
            </div>
        </div>
        <div class="form-group">
            <label for="bp_owner_mobile" class="col-xs-2 control-label">专家头衔</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" name="experttitle" value="{{ user_attr.experttitle }}"  />
            </div>
        </div>
        <div class="form-group">
            <label for="bp_owner_mobile" class="col-xs-2 control-label">擅长领域</label>
            <div class="col-xs-9">
            	{% for r in taglist%}
            		<input type="checkbox" name="field[]" value="{{r.tag_title}}" {% if in_array(r.tag_title,user_attr.field) %} checked="checked"  {% endif %} >{{ r.tag_title }}
            	{% endfor %}
            </div>
        </div>
        {% endif %}
        {% if action != 'see'%}
        <div class="form-group">
            <div class="col-xs-12 text-center">
                <button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
            </div>
        </div>
        {% endif %}
    </form>
</div>


{% endblock %}
